Skip to content

fix: handle truncated model responses explicitly - #36

Merged
minixalpha merged 4 commits into
mainfrom
fix/handle-truncated-model-responses
Sep 9, 2026
Merged

fix: handle truncated model responses explicitly#36
minixalpha merged 4 commits into
mainfrom
fix/handle-truncated-model-responses

Conversation

@minixalpha

@minixalpha minixalpha commented Sep 9, 2026

Copy link
Copy Markdown
Owner

Model replies ending with max_tokens were recorded as completed. Report response_truncated, print a stderr diagnostic, skip tools from the truncated reply, and preserve partial output, usage, and cost accounting. Keep subsequent interactive requests valid by retaining text and a truncation notice without replaying unexecuted tools or unfinished thinking. Headless exit status remains 0; the verifier determines task success.

New Event Journals use schema v2, with v1 replay and projection still supported; public trajectories remain ATIF-v1.7. Update the changelog and bilingual protocol/CLI documentation, regenerate the complete English development notes from the Chinese source, and record the two-case benchmark rerun. Increased generation budgets and automatic continuation are documented as pending requirements; this implementation still stops at the unchanged response limit.

Validation:

  • Core test suite: 205 passed; Harbor adapter tests: 16 passed.
  • CI passed on Python 3.13 and 3.14.
  • Real Docker reruns of regex-log and write-compressor: 0/2 passed at 8192 tokens per response, with no Harbor exceptions. Both runs correctly report response_truncated, and both trajectories pass the official Harbor ATIF validator. The required output files were not created before truncation.

@minixalpha
minixalpha merged commit 06af27d into main Sep 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant